<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent);$(NetCoreAppMinimum)-windows;$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>
    <TargetFrameworks Condition="'$(NetCoreAppPrevious)' != ''">$(TargetFrameworks);$(NetCoreAppPrevious)-windows;$(NetCoreAppPrevious)</TargetFrameworks>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <UseCompilerGeneratedDocXmlFile>false</UseCompilerGeneratedDocXmlFile>
    <IsPackable>true</IsPackable>
    <PackageDescription>Provides the System.Diagnostics.PerformanceCounter class, which allows access to Windows performance counters.

Commonly Used Types:
System.Diagnostics.PerformanceCounter</PackageDescription>

    <!-- TODO https://github.com/dotnet/runtime/issues/90400: Annotate for nullable reference types -->
    <Nullable>disable</Nullable>
    <NoWarn>$(NoWarn);nullable</NoWarn>
  </PropertyGroup>

  <!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
  <PropertyGroup>
    <TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier>
    <NoWarn Condition="$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) != '.NETCoreApp'">$(NoWarn);CA1066</NoWarn>
    <IsPartialFacadeAssembly Condition="$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) == '.NETFramework'">true</IsPartialFacadeAssembly>
    <GeneratePlatformNotSupportedAssemblyMessage Condition="'$(IsPartialFacadeAssembly)' != 'true' and '$(TargetPlatformIdentifier)' != 'windows'">SR.PlatformNotSupported_PerfCounters</GeneratePlatformNotSupportedAssemblyMessage>
  </PropertyGroup>

  <ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'windows'">
    <Compile Include="System\Diagnostics\DiagnosticsConfiguration.cs" />
    <Compile Include="System\Diagnostics\CounterCreationData.cs" />
    <Compile Include="System\Diagnostics\CounterCreationDataCollection.cs" />
    <Compile Include="System\Diagnostics\CounterSample.cs" />
    <Compile Include="System\Diagnostics\CounterSampleCalculator.cs" />
    <Compile Include="System\Diagnostics\ICollectData.cs" />
    <Compile Include="System\Diagnostics\InstanceData.cs" />
    <Compile Include="System\Diagnostics\InstanceDataCollection.cs" />
    <Compile Include="System\Diagnostics\InstanceDataCollectionCollection.cs" />
    <Compile Include="System\Diagnostics\PerformanceCounter.cs">
      <SubType>Component</SubType>
    </Compile>
    <Compile Include="System\Diagnostics\PerformanceCounterCategory.cs" />
    <Compile Include="System\Diagnostics\PerformanceCounterCategoryType.cs" />
    <Compile Include="System\Diagnostics\PerformanceCounterInstanceLifetime.cs" />
    <Compile Include="System\Diagnostics\PerformanceCounterLib.cs" />
    <Compile Include="System\Diagnostics\PerformanceCounterManager.cs" />
    <Compile Include="System\Diagnostics\PerformanceCounterType.cs" />
    <Compile Include="System\Diagnostics\PerformanceDataRegistryKey.cs" />
    <Compile Include="System\Diagnostics\SharedPerformanceCounter.cs" />
    <Compile Include="System\Diagnostics\TraceInternal.cs" />
    <Compile Include="misc\EnvironmentHelpers.cs" />
    <Compile Include="System\Diagnostics\PerformanceData\CounterSet.cs" />
    <Compile Include="System\Diagnostics\PerformanceData\CounterSetInstance.cs" />
    <Compile Include="System\Diagnostics\PerformanceData\CounterSetInstanceCounterDataSet.cs" />
    <Compile Include="System\Diagnostics\PerformanceData\CounterSetInstanceType.cs" />
    <Compile Include="System\Diagnostics\PerformanceData\CounterType.cs" />
    <Compile Include="System\Diagnostics\PerformanceData\PerfProviderCollection.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Interop.BOOL.cs"
             Link="Common\Interop\Windows\Interop.BOOL.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.FormatMessage.cs"
             Link="Common\Interop\Windows\Interop.FormatMessage.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.RegCloseKey.cs"
             Link="Common\Interop\Windows\Interop.RegCloseKey.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.RegQueryValueEx.cs"
             Link="Common\Interop\Windows\Advapi32\Interop.RegQueryValueEx.cs" />
    <Compile Include="$(CoreLibSharedDir)Microsoft\Win32\SafeHandles\SafeRegistryHandle.cs"
             Link="Microsoft\Win32\SafeHandles\SafeRegistryHandle.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Interop.Errors.cs"
             Link="Common\Interop\Windows\Interop.Errors.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Interop.Libraries.cs"
             Link="Common\Interop\Windows\Interop.Libraries.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.ConvertStringSecurityDescriptorToSecurityDescriptor.cs"
             Link="Common\Interop\Windows\Advapi32\Interop.ConvertStringSecurityDescriptorToSecurityDescriptor.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.GetTokenInformation.cs"
             Link="Common\Interop\Windows\Advapi32\Interop.GetTokenInformation.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.PERF_INFO.cs"
             Link="Common\Interop\Windows\Advapi32\Interop.PERF_INFO.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.ProcessOptions.cs"
             Link="Common\Interop\Windows\Advapi32\Interop.ProcessOptions.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.RegConnectRegistry.cs"
             Link="Common\Interop\Windows\Advapi32\Interop.RegConnectRegistry.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.TOKEN_INFORMATION_CLASS.cs"
             Link="Common\Interop\Windows\Advapi32\Interop.TOKEN_INFORMATION_CLASS.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.Constants.cs"
             Link="Common\Interop\Windows\Kernel32\Interop.Constants.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.CreateFileMapping.cs"
             Link="Common\Interop\Windows\Kernel32\Interop.CreateFileMapping.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.DuplicateHandle_SafeWaitHandle.cs"
             Link="Common\Interop\Windows\kernel32\Interop.DuplicateHandle_SafeWaitHandle.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.FreeLibrary.cs"
             Link="Common\Interop\Windows\Kernel32\Interop.FreeLibrary.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.GetComputerName.cs"
             Link="Common\Interop\Windows\Kernel32\Interop.GetComputerName.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.GetCurrentProcess.cs"
             Link="Common\Interop\Windows\kernel32\Interop.GetCurrentProcess.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.GetCurrentProcessId.cs"
             Link="Common\Interop\Windows\Kernel32\Interop.GetCurrentProcessId.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.GetProcessTimes.cs"
             Link="Common\Interop\Windows\Kernel32\Interop.GetProcessTimes.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.HandleOptions.cs"
             Link="Common\Interop\Windows\Kernel32\Interop.HandleOptions.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.LoadLibrary.cs"
             Link="Common\Interop\Windows\Kernel32\Interop.LoadLibrary.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.MapViewOfFile.cs"
             Link="Common\Interop\Windows\Kernel32\Interop.MapViewOfFile.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.MemOptions.cs"
             Link="Common\Interop\Windows\Kernel32\Interop.MemOptions.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.MEMORY_BASIC_INFO.cs"
             Link="Common\Interop\Windows\Kernel32\Interop.MEMORY_BASIC_INFO.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.OpenFileMapping.cs"
             Link="Common\Interop\Windows\Kernel32\Interop.OpenFileMapping.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.OpenProcess.cs"
             Link="Common\Interop\Windows\Kernel32\Interop.OpenProcess.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.PerformanceCounterOptions.cs"
             Link="Common\Interop\Windows\Kernel32\Interop.PerformanceCounterOptions.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.ProcessWaitHandle.cs"
             Link="Common\Interop\Windows\Kernel32\Interop.ProcessWaitHandle.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.SECURITY_ATTRIBUTES.cs"
             Link="Common\Interop\Windows\Kernel32\Interop.SECURITY_ATTRIBUTES.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.UnmapViewOfFile.cs"
             Link="Common\Interop\Windows\Kernel32\Interop.UnmapViewOfFile.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.VirtualQuery.cs"
             Link="Common\Interop\Windows\Kernel32\Interop.VirtualQuery.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.WaitForSingleObject.cs"
             Link="Common\Interop\Windows\Kernel32\Interop.WaitForSingleObject.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Pdh\Interop.PdhFormatFromRawValue.cs"
             Link="Common\Interop\Windows\Pdh\Interop.PdhFormatFromRawValue.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\PerfCounter\Interop.PerformanceData.cs"
             Link="Common\Interop\Windows\PerfCounter\Interop.PerformanceData.cs" />
    <Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\SafePerfProviderHandle.cs"
             Link="Common\Microsoft\Win32\SafeHandles\SafePerfProviderHandle.cs" />
    <Compile Include="$(CommonPath)System\Diagnostics\NetFrameworkUtils.cs"
             Link="Common\System\Diagnostics\NetFrameworkUtils.cs" />
  </ItemGroup>

  <ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
    <Compile Include="$(CommonPath)DisableRuntimeMarshalling.cs"
             Link="Common\DisableRuntimeMarshalling.cs" />
  </ItemGroup>

  <ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
    <ProjectReference Include="$(LibrariesProjectRoot)System.Configuration.ConfigurationManager\src\System.Configuration.ConfigurationManager.csproj" />
  </ItemGroup>

</Project>
